#include <stdio.h>
int main()
{
#if 0
    /*for循环*/
    int count = 3;
    for (size_t i = 0; i < count; i++)
    {
        printf("hello world\n");
    }

#endif
    /*计算1-4999的偶数和*/
#if 0
    int result = 0;
    for (int idx = 1; idx <= 4999; idx++)
    {
        if (idx % 2 == 0)
        {
            result = result + idx;
        }
    }
    printf("偶数和为%d\n", result);
#endif
#if 0
    /*while循环*/
    // 千万不要死循环!!!!!
    int cnt = 5;
    while (cnt)
    {
        printf("welcome to 271class \n");
        cnt = cnt - 1;
    }

#endif
#if 0
    int jdx = 1, i = 1;
    while (jdx <= 100)
    {
        printf("%d ", jdx);
        jdx++;
        i++;
        if (i > 3)
        {
            printf("\n");
            i = 1;
        }
        // 每三个一换行可以用jdx%3==0来做判断更简单
    }

#endif
#if 0
/*
前置：先运算后判断
后置：先判断后运算
*/
#endif
#if 1
    /*找出12-10000里所有回文数的个数*/
    int num, num1 , num2 , fire = 0;
    for (num = 12; num <= 10000; num++)
    {
        int number = num;
        num2 = 0;
        while (number)
        {
            num1 = number % 10;
            num2 = num2 * 10 + num1;
            number= number / 10;
        }
        if (num2 == num)
        {
            fire++;
        }
    }
    printf("共有%d个\n", fire);

#endif
#if 1
/*do...while*/
int flag = 0;
do
{
    printf("7777");
} while (flag);


#endif
#if 1

#endif
    return 0;
}